{% extends "base.html" %}
{% block mainbody %}
    <p style="margin-left: 50px;font-size: 30px">豆瓣电影 TOP 250</p>
    <br>
<div class="row">
    <div class="col-md-6">
        {% for contact in page %}
        <div class="media" style="margin-left:50px ">
            <div class="media-left">
                <a href={{ contact.movie_url }}>
                  <img width="110" class="media-object" src="/static/image/{{ contact.img_name }}" alt={{ contact.name }}>
                </a>
            </div>
            <div class="media-body">
                <div class="media-heading">
                    <a href={{ contact.movie_url }}>
                        <span class="title" >{{ contact.name }}</span>
                    </a>
                </div>
                <p>
                            {{ contact.actor }}<br>
                            {{ contact.releasetime }}
                </p>
                <span class="rating_num" property="v:average">评分:<a style="color: #e38d13">{{ contact.stars }}</a></span>
                <span>&nbsp;{{ contact.score_num }}</span>
                <p class="quote">
                    <br>
                    <span class="inq">“{{ contact.describe }}”</span>
                </p>
            </div>
        </div>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-----------------------------------------------------------------------------------------------------------------------</p>
        {% endfor %}
    </div>
</div>

<div style="margin-left:50px ">
    <nav aria-label="Page navigation">
      <ul class="pagination">
        <!--上一页-->
        <li class="{% if not page.has_previous %}disabled{% endif %}">
          {% if page.has_previous %}
            <a href="?page={{ page.previous_page_number }}" aria-label="Previous">
          {% endif %}
            <span aria-hidden="true">&laquo;</span>
          </a>
        </li>

        <!--页码-->
        <!--这里展示页码使用传递过来的dis_range -->
        {% for num in dis_range %}
        <li class="{% if num == page.number %}active{% else %}{% endif %}" >
          <a href="?page={{ num }}">{{ num }}</a>
        </li>
        {% endfor %}

        <!--下一页-->
        <li class="{% if not page.has_next %}disabled{% endif %}">
          {% if page.has_next %}
            <a href="?page={{ page.next_page_number }}" aria-label="Next">
          {% endif %}
            <span aria-hidden="true">&raquo;</span>
          </a>
        </li>
      </ul>
    </nav>
</div>

{% endblock %}